﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CoVanHocTapData.Concretes;
using CoVanHocTapProject.Infrastructure;

namespace CoVanHocTapProject.Controllers
{
    public class TheoDoiSinhVienController : Controller
    {
        SinhVienRepository sinhVienRepo = new SinhVienRepository();
        //
        // GET: /TheoDoiSinhVien/

        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /TheoDoiSinhVien/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /TheoDoiSinhVien/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /TheoDoiSinhVien/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /TheoDoiSinhVien/Edit/5
 
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /TheoDoiSinhVien/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /TheoDoiSinhVien/Delete/5
 
        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /TheoDoiSinhVien/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }


        public ActionResult TheoDoiSinhVien()
        {
            ViewData["TinChiTichLuyTongQuat"] = sinhVienRepo.TinChiTichLuyCua("081324T");
            ViewData["TinChiTichLuyBatBuoc"] = sinhVienRepo.TinChiTichLuyBatBuocCua("081324T");
            ViewData["TinChiTichLuyTuChon"] = sinhVienRepo.TinChiTichLuyTuChonCua("081324T");
            //ViewData["MaMonAVGTCaoNhatDaHT"];
            ViewData["DiemToeicDaHT"] = sinhVienRepo.DiemToeicDaHT("081289T").ToString();
            ViewData["HocPhanAVGTDaHT"] = sinhVienRepo.DSMonAVGTDaHT("081324T");
            ViewData["DSHocPhanGDTCDaHT"] = sinhVienRepo.DSMonGDTCDaHT("081289T");
            ViewData["DSHocPhanGDQPDaHT"] = sinhVienRepo.DSMonGDQPDaHT("081324T");
            //ViewData["TenMonHocGDTCDaHT"];
            //ViewData["TenHPGDQPDaHT"];
            //ViewData["TinChiTichLuyTongQuat"] = sinhVienRepo.TinChiTichLuyCua("081289T");
            //ViewData["TinChiTichLuyBatBuoc"] = sinhVienRepo.TinChiTichLuyBatBuocCua("081289T");
            //ViewData["TinChiTichLuyTuChon"] = sinhVienRepo.TinChiTichLuyTuChonCua("081289T");
            return View();
        }
    }
}
